<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:p="http://primefaces.org/ui"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:cc="http://java.sun.com/jsf/composite">

   <cc:interface>
       <cc:attribute name="label" required="true" shortDescription="The label for the output"/>
       <cc:attribute name="value" required="true" shortDescription="The value for the output"/>
       <cc:attribute name="display" required="true" shortDescription="The value for the output when in readonly mode"/>
       <cc:attribute name="items" required="true" shortDescription="The items of the select"/>
       <cc:attribute name="readonly" required="false" default="false" type="java.lang.Boolean" shortDescription="Whether the select is readonly"/>
   </cc:interface>

    <cc:implementation>
        <h:panelGrid columns="2" styleClass="width100pc" columnClasses="width95pc,width5pc">
            <h:selectOneMenu
                    id="select"
                    label="#{cc.attrs.label}"
                    converter="#{cc.attrs.converter}"
                    value="#{cc.attrs.value}"
                    styleClass="width100pc"
                    rendered="#{!cc.attrs.readonly}">
                <cc:insertChildren />
            </h:selectOneMenu>
            <h:outputText id="select2" value="#{cc.attrs.display}" styleClass="width100pc" rendered="#{cc.attrs.readonly}" />
            <p:message for="select" showSummary="false" showDetail="false" display="icon" />
        </h:panelGrid>
    </cc:implementation>
</ui:composition>
